﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing {
    import org.aswing.event.*;
    import org.aswing.plaf.basic.*;

    public class JScrollBar extends Component implements Orientable {

        public static const HORIZONTAL:int = 0;
        public static const VERTICAL:int = 1;

        private var model:BoundedRangeModel;
        private var orientation:Number;
        private var unitIncrement:Number;
        private var blockIncrement:Number;

        public function JScrollBar(_arg1:int=1, _arg2:int=0, _arg3:int=10, _arg4:int=0, _arg5:int=100){
            setName("JScrollBar");
            this.unitIncrement = 1;
            this.blockIncrement = ((_arg3 == 0)) ? 10 : _arg3;
            this.setOrientation(_arg1);
            this.setModel(new DefaultBoundedRangeModel(_arg2, _arg3, _arg4, _arg5));
            this.updateUI();
        }
        override public function updateUI():void{
            setUI(UIManager.getUI(this));
        }
        override public function getDefaultBasicUIClass():Class{
            return (BasicScrollBarUI);
        }
        override public function getUIClassID():String{
            return ("ScrollBarUI");
        }
        public function getOrientation():int{
            return (this.orientation);
        }
        public function setOrientation(_arg1:int):void{
            var _local2:int = this.orientation;
            this.orientation = _arg1;
            if (_arg1 != _local2){
                revalidate();
                repaint();
            };
        }
        public function getModel():BoundedRangeModel{
            return (this.model);
        }
        public function setModel(_arg1:BoundedRangeModel):void{
            if (this.model != null){
                this.model.removeStateListener(this.__modelStateListener);
            };
            this.model = _arg1;
            if (this.model != null){
                this.model.addStateListener(this.__modelStateListener);
            };
        }
        public function setUnitIncrement(_arg1:int):void{
            this.unitIncrement = _arg1;
        }
        public function getUnitIncrement():int{
            return (this.unitIncrement);
        }
        public function setBlockIncrement(_arg1:int):void{
            this.blockIncrement = _arg1;
        }
        public function getBlockIncrement():int{
            return (this.blockIncrement);
        }
        public function getValue():int{
            return (this.getModel().getValue());
        }
        public function setValue(_arg1:int, _arg2:Boolean=true):void{
            var _local3:BoundedRangeModel = this.getModel();
            _local3.setValue(_arg1, _arg2);
        }
        public function getVisibleAmount():int{
            return (this.getModel().getExtent());
        }
        public function setVisibleAmount(_arg1:int):void{
            this.getModel().setExtent(_arg1);
        }
        public function getMinimum():int{
            return (this.getModel().getMinimum());
        }
        public function setMinimum(_arg1:int):void{
            this.getModel().setMinimum(_arg1);
        }
        public function getMaximum():int{
            return (this.getModel().getMaximum());
        }
        public function setMaximum(_arg1:int):void{
            this.getModel().setMaximum(_arg1);
        }
        public function getValueIsAdjusting():Boolean{
            return (this.getModel().getValueIsAdjusting());
        }
        public function setValueIsAdjusting(_arg1:Boolean):void{
            var _local2:BoundedRangeModel = this.getModel();
            _local2.setValueIsAdjusting(_arg1);
        }
        public function setValues(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Boolean=true):void{
            var _local6:BoundedRangeModel = this.getModel();
            _local6.setRangeProperties(_arg1, _arg2, _arg3, _arg4, _local6.getValueIsAdjusting(), _arg5);
        }
        public function addStateListener(_arg1:Function, _arg2:int=0, _arg3:Boolean=false):void{
            addEventListener(InteractiveEvent.STATE_CHANGED, _arg1, false, _arg2);
        }
        public function removeStateListener(_arg1:Function):void{
            removeEventListener(InteractiveEvent.STATE_CHANGED, _arg1);
        }
        protected function __modelStateListener(_arg1:InteractiveEvent):void{
            dispatchEvent(new InteractiveEvent(InteractiveEvent.STATE_CHANGED, _arg1.isProgrammatic()));
        }
        override public function setEnabled(_arg1:Boolean):void{
            super.setEnabled(_arg1);
            mouseChildren = _arg1;
        }

    }
}//package org.aswing 
